package za.org.jcicada.genss.sensor.impl;

import za.org.jcicada.genss.sensor.IStatusStrategy;

public class StatusStrategyFactory {

	public static IStatusStrategy createStatusStrategy(Sensor sensor, String params) {
		String[] split = params.split(":");
		String type = split[0];
		if (type.equals("Discrete"))
			return new StatusStrategyDiscrete((TypeDiscrete)sensor.getType(), split[1]);
		if (type.equals("Float"))
			return new StatusStrategyFloat((TypeFloat)sensor.getType(), split[1]);
		if (type.equals("Int"))
			return new StatusStrategyInt((TypeInt)sensor.getType(), split[1]);
		return null;
	}
}
